﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports System.Data.SqlClient

Public Class SqlServerNguoiDung

    Private oqLBase As New hDBase
    Private oDataSet As New DataSet
    Private oDatatable As New DataTable

    Public Function CheckDangNhap(ByVal sConnString As String, ByVal oNguoiDung As NguoiDung) As Boolean
        Dim SqlParam As SqlParameter() = {New SqlParameter("@TenDangNhap", SqlDbType.VarChar, 50), _
                                       New SqlParameter("@MatKhau", SqlDbType.VarChar, 50)}
        SqlParam(0).Value = oNguoiDung.TenDangNhap
        If (oNguoiDung.MatKhau.Equals("") = True) Then
            SqlParam(1).IsNullable = True
            SqlParam(1).SqlValue = Nothing
        Else
            SqlParam(1).Value = oNguoiDung.MatKhau
        End If
        Try
            oqLBase.Connection(sConnString)
            oqLBase.RunStoreProcedures("Proc_Get_NguoiDung_By_Ten_MK", "NguoiDung", SqlParam)
            Return True
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return False
        End Try
    End Function


End Class
